It’s been a long time since the last time I checked the available software for managing long running processes. Software in this particular area has evolved and, after some research and testing on a virtual machine, I tried to install supervisord in a CentOS 5.6 box. Unfortunately, no RPM package exists for the latest 3.X version, so I decided to go through the procedure to rebuild the supervisor RPM from the Fedora development tree, since v3.X has some really cool features I cannot do without.
If you haven’t built an RPM package before, you will need to go through a simple procedure in order to prepare an RPM building environment. It is highly recommended that you build your packages in a separate box, dedicated to this kind of work, and also use a typical user and not root for building. So, let’s get the source RPM of supervisord from a Fedora Rawhide mirror:
wget ftp://ftp.cc.uoc.gr/mirrors/linux/fedora/linux/development/rawhide/source/SRPMS/supervisor-3.0-0.4.a10.fc16.src.rpm
The simplest way to build an RPM for our CentOS release is to use the --rebuild
option of rpmbuild
:
rpmbuild --rebuild supervisor-3.0-0.4.a10.fc16.src.rpm
Wait a few seconds for it to finish and then your binary RPM package will be in ~/<your_building_env>/RPMS/...
.
To satisfy dependencies, you will also need the package python-meld3. So, download and rebuild it:
wget ftp://ftp.cc.uoc.gr/mirrors/linux/fedora/linux/development/rawhide/source/SRPMS/python-meld3-0.6.7-4.fc16.src.rpm rpmbuild --rebuild python-meld3-0.6.7-4.fc16.src.rpm
Having built RPM packages for supervisor and python-meld3, you can now transfer them to a testing box and install them:
yum localinstall /path/to/supervisor.rpm /path/to/python-meld3 yum install python-elementtree
We also installed elementtree as this is a dependency missing from the supervisor spec file (note to self: file a bug report).
Finally, try to start supervisord:
/etc/init.d/supervisord start
Surprisingly, it complains about the missing elementtree!
Starting supervisord: Traceback (most recent call last): File "/usr/bin/supervisord", line 5, in ? from pkg_resources import load_entry_point File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2479, in ? working_set.require(__requires__) File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 585, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 483, in resolve raise DistributionNotFound(req) # put more info here pkg_resources.DistributionNotFound: elementtree
Checking the requirements file at: /usr/lib/python2.4/site-packages/supervisor-3.0a10-py2.4.egg-info/requires.txt
there are no special version requirements:
meld3 >= 0.6.5 elementtree [iterparse] cElementTree >= 1.0.2
After some investigation on the supervisor-users mailing list, I found a message that indicated that setuptools.setup() should be used instead of distutils.core.setup() in the setup.py script.
So, the dependency resolution depends on the way the package has been installed! I didn’t even bother to patch setup.py… Knowing that the dependencies are correctly installed, I commented out the elementtree
line and also the meld3
line as this caused the same error.
So, my /usr/lib/python2.4/site-packages/supervisor-3.0a10-py2.4.egg-info/requires.txt
file looks like this:
#meld3 >= 0.6.5 #elementtree [iterparse] cElementTree >= 1.0.2
Now supervisor starts without errors:
# /etc/init.d/supervisord start Starting supervisord: [ OK ] # cat /var/log/supervisor/supervisord.log 2011-05-12 02:56:08,221 CRIT Supervisor running as root (no user in config file) 2011-05-12 02:56:08,267 INFO RPC interface 'supervisor' initialized 2011-05-12 02:56:08,267 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2011-05-12 02:56:08,271 INFO daemonizing the supervisord process 2011-05-12 02:56:08,272 INFO supervisord started with pid 21337
This is what it takes to run supervisord 3 in CentOS 5 or RHEL 5. If you have any comments and suggestions, please let me know in the comments below.
Running supervisor 3 on CentOS 5 by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2011 - Some Rights Reserved
Nils, thanks for your feedback. I had actually used the procedure you described (
rpm -i –nomd5
to extract the srpm contents to the appropriate directories in the rpmbuild tree and thenrpmbuild -ba
to create the packages), but in order to make it simpler for the readers I used therpmbuild --rebuild
option in the post. That was a bad choice, because I completely forgot about the md5 issue in C5 and thus the instructions were not accurate. Thanks for pointing this out.Thanks for these instructions!
The fc16 rawhide package is no longer available, but I used this rpm (note: link down) instead. (Once Fedora 16 is released, this link will probably also die, but you should be able to get the SRPM from the Fedora 16 release repository after that date.)
The rpmbuild –rebuild command also failed on our CentOS 5 build server with an MD5 error, which seems to be caused by the newer RPM format used in Fedora. As a workaround I used a combination of ‘rpm -i –nomd5’ and ‘rpmbuild -bb’ instead:
I’ve rebuilt the latest supervisor for el/centos/sl6, the build is available at
http://repos.fedorapeople.org/repos/rmarko/supervisor/
Thanks for the instructions.
Richard, your work is much appreciated.
Thank you Richard, that is just awesome!
Just wondering, is the EL6 supervisor package still maintained?